export type InvoicableOrdersResponseShape = {
  name: string;
  orderNo: string;
  payPrice: string;
  payTime: string;
}[];

export const enum ApiInvoiceStatus {
  InProgress = 0,
  Invoiced = 1,
  Cancelled = 2,
}

export const generateInvoiceStatusText = (status: ApiInvoiceStatus) => {
  return status === ApiInvoiceStatus.Invoiced
    ? "已开票"
    : status === ApiInvoiceStatus.Cancelled
    ? "已取消"
    : "开票中";
};

export type InvoiceHistoryShape = {
  name: string;
  invoiceId: number;
  orderNo: string;
  invoicePrice: string;
  invoiceTime: string;
  status: ApiInvoiceStatus;
}[];

export const enum ApiInvoiceType {
  Personal = 1,
  Company = 2,
}

export type InvoiceDetailShape = {
  id: number;
  type: ApiInvoiceType;
  name: string;
  corporateName: string;
  companyTaxNumber: string;
  price: string;
  status: ApiInvoiceStatus;
  url: string;
  createTime: string;
  orderList: InvoicableOrdersResponseShape;
};
